package emarket;

public class Item 
{

	private String _name;		// Unique identifier
	
	
	public Item ( String name )
	{
		this._name = name;
	}

	public void set_name(String _name) {
		this._name = _name;
	}

	public String get_name() {
		return _name;
	}
	
	public boolean equals(Object o )
	{
		
		if(!(o instanceof Item))
		{
			throw new ClassCastException("Invalid object");
		}
		
		Item other = (Item) o;
		
		if( this == other )
			return true;
		
		if( other.get_name().equals( this._name ) )
			return true;
		
		return false;
	}
	
	public String toString()
	{
		return _name;
	}
}
